function hungry_uploadimg(upload_url, callback) {
	if (upload_url == '' || typeof(upload_url) == 'undefined') {
		upload_url = 'index.php?g=admin&m=pro&a=file';
	}

	KindEditor.ready(function(K) {
		//Product.prototype.afterUpload(cfg.url_id);
		window.editor = K.create('.pro-view', {

			afterCreate: function() {

				this.sync();
			},
			afterBlur: function() {
				this.sync();
			}
		});


		$("a.localUpload").click(function() {
			var _this = $(this);
			var img_id = _this.parent().find("input[id^='uploadButton_']").attr('return_url');

			if (_this.parent().find('img').length == 0) {

			} else {
				_this.parent().find('img').remove();
			}
			_this.parent().append('<img id="loading_' + img_id + '" src="Admin/webroot/images/loading.gif"/>');
		});
		$("input[id^='uploadButton_']").each(function(i, v) {

			var _this = this;
			var index = i;
			if (callback) {
				var _callback = callback;
			} else {
				var _callback = function(data) {
					$(_this).parent().find('img#loading_' + $(_this).attr('return_url')).hide();
					if (data.error === 0) {

						var url = K.formatUrl(data.url, 'absolute');

						K('#' + $(_this).attr('return_url')).val(url);
					} else {
						alert(data.message);
					}
				}

			}
			if ($(this).css('display') != 'none') {

				var uploadbutton = K.uploadbutton({

					button: _this,
					fieldName: 'file_name',
					url: upload_url,
					afterUpload: _callback,
					afterError: function(str) {
						$(_this).parent().find('img#loading_' + $(_this).attr('return_url')).hide();
						alert('自定义错误信息: ' + str);
					}
				});
				//console.log(uploadbutton);

				uploadbutton.fileBox.change(function(e) {
					uploadbutton.submit();

				});
			}
		}); //each
	});
}